package STUDENT.TRINHQUANGXUANDUC.OPPS.CALCULATOR;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		Controllers ca_controll = new Controllers();
		CalculatorObject object = new CalculatorObject();
		String value = "";
		Scanner sc = new Scanner(System.in);
		System.out.println("-----Chuong trinh tinh toan------");
		while (value.isEmpty()) {
			System.out.println("Nhap gia tri a:");
			value = sc.nextLine();
			if (value.isEmpty()) {
				System.out.println("Nhap gia tri a:");
			} else {
				object.setA(Double.parseDouble(value));
			}
		}
		value = "";
		sc = new Scanner(System.in);
		while (value.isEmpty()) {
			System.out.println("Nhap gia tri b:");
			value = sc.nextLine();
			if (value.isEmpty()) {
				System.out.println("Nhap gia tri b:");
			} else {
				object.setB(Double.parseDouble(value));
			}

		}
		value = "";
		sc = new Scanner(System.in);
		while (value.isEmpty()) {
			System.out.println("Chon phep tinh: 1.Cong/2.Tru/3.Nhan/4.Chia");
			value = sc.nextLine();
			if (value.isEmpty()) {
				System.out.println("Chon phep tinh: 1.Cong/2.Tru/3.Nhan/4.Chia");
			} else {
				object.setIopt(Integer.parseInt(value));
			}
		}
		System.out.println("Ket qua la :" + ca_controll.Tinhtoan(object));
	}
}
